//
//  CftModelData.m
//  Fragrance
//
//  Created by mark on 15/5/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "CftModelData.h"

@implementation CftModelData

- (void)dealloc
{
    [_name  release];
    [_desc release];
    [_shopName release];
    [_chefIconUrl release];
    [_chefNickName release];
    [_favoriteNum release];
    [_picListarrayData release];
    [super dealloc];
    
}

- (NSMutableArray *)picListarrayData
{
    if (!_picListarrayData) {
        _picListarrayData = [[NSMutableArray alloc] init];
    }
    return _picListarrayData;
}

- (instancetype)initWithDictionary:(NSDictionary *)resultDictionary
{
    self = [super init];
    if (self) {
        
        self.desc = [resultDictionary objectForKey:@"desc"];
        
        self.favoriteNum = [[resultDictionary objectForKey:@"favoriteNum"] stringValue];
        self.name = [resultDictionary objectForKey:@"name"];
        NSDictionary *dictionary2 = [resultDictionary objectForKey:@"shop"];
        self.chefIconUrl = [dictionary2 objectForKey:@"chefIcon"] ;
        self.chefNickName = [dictionary2 objectForKey:@"chefNickname"];
        self.shopName = [dictionary2 objectForKey:@"shopName"];
        
        NSArray *array1 = [resultDictionary objectForKey:@"picList"];
        for (NSDictionary *dic2 in array1) {
            
            PicListModelData *model1 = [[PicListModelData alloc] initWithDictionary:dic2];
            
            [self.picListarrayData addObject:model1];
        }
        
    }
    return self;
}

@end
